var {make, wrapper, postJSON} = require("wechat-api/lib/util")
make(exports, "sendPromMsg", function (openid, info, cb) {
	var url = this.endpoint + "/cgi-bin/message/custom/send?access_token=" + this.token.accessToken
	var obj = {
		"touser": openid,
		"msgtype": "miniprogrampage",
		"miniprogrampage": info	
	}
	this.request(url, postJSON(obj), wrapper(cb))
})

make(exports, "sendPromNews", function (openid, info, cb) {
	var url = this.endpoint + "/cgi-bin/message/custom/send?access_token=" + this.token.accessToken
	var obj = {
		"touser": openid,
		"msgtype": "link",
		"link": info	
	}
	this.request(url, postJSON(obj), wrapper(cb))
})